let {BaseController} = require('./baseController') 

const  userModel = require('../models/userModel')

class UserController extends BaseController {
	async showUsers (ctx){
		//var userM = new UserModel();
		//console.log(userM)
		let query = userModel.find();
		//await new Promise(function(resolve,reject){}) 多个方式

		await new Promise(function(resolve,reject){
			query.exec(function(err, characters) {
				if(err){
					reject(err);
				}else{
					
					resolve(characters);
				}
			})	
		});
		
	}
}


module.exports = UserController